<html>
<head><meta charset="utf-8"><title>psp libc · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html">psp libc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204986253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204986253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Sajna <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204986253">(Jul 25 2020 at 03:42)</a>:</h4>
<p><span class="user-mention" data-user-id="217081">@Yuki Okushi</span> quick question on the psp libc, we screwed up by doing #[derive(Copy)] instead of #[derive(::Copy)], should we import or change it?</p>



<a name="204986263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204986263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Sajna <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204986263">(Jul 25 2020 at 03:43)</a>:</h4>
<p>for enums, which don't have a macro</p>



<a name="204987472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204987472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204987472">(Jul 25 2020 at 04:23)</a>:</h4>
<p>Use <code>impl ::Copy</code> like other platform's enum.</p>



<a name="204987578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204987578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Sajna <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204987578">(Jul 25 2020 at 04:26)</a>:</h4>
<p>kk</p>



<a name="204989056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204989056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Sajna <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204989056">(Jul 25 2020 at 05:16)</a>:</h4>
<p>what about for clone?</p>



<a name="204995756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204995756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204995756">(Jul 25 2020 at 09:03)</a>:</h4>
<p>let'd do the same way as others</p>



<a name="204995767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/204995767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#204995767">(Jul 25 2020 at 09:03)</a>:</h4>
<p>others = other platform's</p>



<a name="205017689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205017689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Sajna <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205017689">(Jul 25 2020 at 19:15)</a>:</h4>
<p>The thing is, we have way more enums than the other platforms. I don't know if 107 manual implementations of Clone makes sense.</p>



<a name="205018947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205018947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205018947">(Jul 25 2020 at 19:46)</a>:</h4>
<p>Fun fact: deriving takes longer to build than the version that writes it out. You can probably use a macro_rules to do it, and all that.</p>
<p>Source: winapi deliberately doesn't derive because deriving is slower to build than manually writing the impl within the macro_rules that declares each type.</p>



<a name="205019080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205019080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205019080">(Jul 25 2020 at 19:51)</a>:</h4>
<p><code>#[derive(Copy, Clone)]</code> is supposed to have a shortcut that generates a trivial Clone impl</p>



<a name="205021055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205021055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Peter Rabbit <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205021055">(Jul 25 2020 at 20:47)</a>:</h4>
<p>It does, but manually writing out that shortcut also works and is slightly faster to compile</p>



<a name="205021102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205021102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205021102">(Jul 25 2020 at 20:48)</a>:</h4>
<p>Hmm, "slightly"? Did you measure what exactly is faster by any chance?</p>



<a name="205021107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205021107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205021107">(Jul 25 2020 at 20:48)</a>:</h4>
<p>I wouldn't expect derive expansion to take much time, so maybe there's some low-hanging fruits to look into here</p>



<a name="205039111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205039111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Sajna <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205039111">(Jul 26 2020 at 06:38)</a>:</h4>
<p><span class="user-mention" data-user-id="217081">@Yuki Okushi</span>  <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="205065386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205065386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Glenn Hope <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205065386">(Jul 26 2020 at 20:07)</a>:</h4>
<p>Would it make sense for us to modify the <code>s!</code> macro to also create the Copy/Clone impls for enums?</p>



<a name="205067911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/psp%20libc/near/205067911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/psp.20libc.html#205067911">(Jul 26 2020 at 21:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="257587">Glenn Hope</span> <a href="#narrow/stream/122651-general/topic/psp.20libc/near/205065386">said</a>:</p>
<blockquote>
<p>Would it make sense for us to modify the <code>s!</code> macro to also create the Copy/Clone impls for enums?</p>
</blockquote>
<p>I think it makes sense, or we could also declare <code>e!</code>, either works for me</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>